package cn.magictodo.weblog.web.controller;

import cn.magictodo.weblog.common.utils.Response;
import cn.magictodo.weblog.web.model.vo.ip.AddIpReqVO;
import cn.magictodo.weblog.web.service.IpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ip服务
 *
 * @author liu
 * @since 2024-03-25 17:04
 */
@RestController
@RequestMapping("/ip")
@Api(value = "ip服务")
public class IpController {
    @Autowired
    private IpService ipService;

    /**
     * 添加 ip
     *
     * @param addIpReqVO
     * @return
     */
    @PostMapping("/add")
    @ApiOperation(value = "添加 ip")
    public Response addIp(@RequestBody @Validated AddIpReqVO addIpReqVO) {
        return ipService.addIp(addIpReqVO);
    }
}
